<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style type="text/css">
</style>
<script type="text/javascript" src="/board/js/jquery-1.11.1.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$('#id').change(function(){
		var id = $('#id').val();
					
		for(var i = 0; i< id.length; ++i){
			var c = id.charCodeAt(i);
			if(c < 48 || c > 122){
				alert('全角は入力できません。');
				$('#id').val('');
				$('#id').focus();
				return;
			}
		}
	});
	
	$('#password').change(function(){
		var password = $('#password').val();
		
		for(var i = 0; i< password.length; ++i){
			var c = password.charCodeAt(i);
			if(c < 48 || c > 122){
				alert('全角は入力できません。');
				$('#password').val('');
				$('#password').focus();
				return;
			}
		}
	});
});
function formCheck(){
	var id = $('#id').val();
	var name = $('#name').val();
	var password = $('#password').val();
	var rights_value = $('#rights_value').val();
	
	//check!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
	
	return true;
}
</script>
<title>ユーザー登録</title>
</head>
<body>
<body>
	<s:form action="insertMember" method="post" theme="simple" onsubmit="javascript: return formCheck();">
		<table>
			<tr>
				<th>ユーザー登録画面</th>
			</tr>
			<tr>
				<td class="user_id">ユーザーID</td>
				<td class="user_id"><s:textfield name="id" id="id" /></td>
			</tr>
			<tr>
				<td class="user_id">ユーザー名</td>
				<td class="user_id"><s:textfield name="name" id="name" /></td>
			</tr>
			<tr>
				<td class="user_id">パスワード</td>
				<td class="user_id"><s:password name="password" id="password" /></td>
			</tr>
			<tr>
				<td class="user_id">権限</td>
				<td class="user_id">
				<select name="rights_value" id="rights_value">
					<option>全社員</option>
					<option>正社員</option>
					<option>幹部社員</option>
					<option>管理者</option>
				</select>
				</td>
			</tr>
			<tr>
				<td></td>
				<td><s:submit class="btn" value="登録" /> 
				<input type="button" class="btn" value="閉じる" onclick="javascript: closeWindow();"> </td>
			</tr>
			<tr>
				<td colspan="2"><s:if test="loginFail == true">
									<span id="loginFail">正しいユーザーIDとパスワードを入力してください。</span>
								</s:if>
				</td>
			</tr>			
		</table>
	</s:form>
</body>
</html>